home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 43 / Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso / -serious- / wb / backclock / sources / notify.c < prev    next >
C/C++ Source or Header  |  1999-06-15  |  2KB  |  50 lines

  1. /*****************************************************************************
  2.  * 
  3.  * name                    : notify.c
  4.  * description            : handle the notify intuition library
  5.  * version                : 1.3
  6.  *
  7.  * created                : ?
  8.  * last change            : 05-06-99
  9.  *
  10.  *****************************************************************************
  11.  */
  12. #include <libraries/notifyintuition.h>
  13. #include <exec/memory.h>
  14.  
  15. #include <proto/exec.h>
  16. #include <string.h>
  17. #include <stdio.h>
  18. #include "utils.h"
  19. #include <clib/rtracker_protos.h>
  20. #include <pragmas/rtracker_pragmas.h>
  21.  
  22. extern struct Library * RTrackerLibrary ;
  23.  
  24. #define SCREEN "Workbench#?"
  25.  
  26. int startNotify(idWin * prj) {
  27.   /* initialise notification
  28.    */
  29.   int ret = FALSE ;
  30.   if ((prj->Notify->inr_Name  = NewAllocMem(sizeof(SCREEN), MEMF_PUBLIC)) != NULL) {
  31.     if ((prj->notifyPort      = NewCreateMsgPort()) != NULL) {
  32.       strcpy(prj->Notify->inr_Name, SCREEN) ;
  33.       prj->Notify->inr_Flags         = INRF_SEND_MESSAGE|INRF_WAIT_REPLY|INRF_BEFORE_CLOSEWORKBENCH|INRF_AFTER_OPENWORKBENCH ;
  34.       prj->Notify->inr_stuff.inr_Msg.inr_Port          = prj->notifyPort ;
  35.       prj->Notify->inr_Pri           = 101 ;
  36.       prj->Notify->inr_UniqueID      = 'MYCL' ;
  37.       NotIStartNotify(prj->Notify) ;
  38.       ret = TRUE ;
  39.     }
  40.   }
  41.   return(ret) ;
  42. }
  43.  
  44. void endNotify(idWin * prj) {
  45.   /* terminate notifiaction
  46.    */
  47.   if (prj->Notify)           NotIEndNotify(prj->Notify) ;
  48.   if (prj->notifyPort)       NewDeleteMsgPort(prj->notifyPort) ; 
  49.   if (prj->Notify->inr_Name) NewFreeMem(prj->Notify->inr_Name) ;
  50. }